Skip to content

fix(ui): Pattern hover animation drift and flicker#700

Open
ankitkr104 wants to merge 2 commits intoAOSSIE-Org:mainfrom
ankitkr104:fix/pattern-zoom-animation
Open

fix(ui): Pattern hover animation drift and flicker#700
ankitkr104 wants to merge 2 commits intoAOSSIE-Org:mainfrom
ankitkr104:fix/pattern-zoom-animation

Conversation

@ankitkr104
Copy link
Contributor

@ankitkr104 ankitkr104 commented Mar 23, 2026

  • Resolved SVG zooming drift by setting absolute pixel-based transform origins
  • Eliminated rapid hover flickering by utilizing an invisible static rect hit-area
  • Upgraded zoom effects with a snappy cubic-bezier bounce curve
  • Added alternating rotation physics to symbols mimicking a playful 3D effect
  • Maintained sharp rx constraints per design specs

Recordings:

Aossie.web.mp4

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.

  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • New Features

    • Interactive hover targets added to pattern elements, enabling consistent pointer/hover behavior and alternating rotation on hover.
  • Style

    • Improved visual polish with smoother color transitions, enhanced shadows, scale/rotation animations, and refined animation timing for more engaging feedback.

- Resolved SVG zooming drift by setting absolute pixel-based transform origins
- Eliminated rapid hover flickering by utilizing an invisible static rect hit-area
- Upgraded zoom effects with a snappy cubic-bezier bounce curve
- Added alternating rotation physics to symbols mimicking a playful 3D effect
- Maintained sharp rx constraints per design specs
@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

📝 Walkthrough

Walkthrough

The SVG-based Pattern component was refactored to wrap each grid cell in a <g> with a transparent hit area, merge incoming className onto the root <svg>, and add transition, shadow, scale and alternating-rotation hover animations while making the visual <use> non-interactive.

Changes

Cohort / File(s) Summary
Pattern component
src/components/shared/Pattern.jsx
Root <svg> now merges className and includes overflow-visible. Grid <use> elements are wrapped in <g> groups with a transparent <rect> hit area; hover animations added (scale, alternating rotation, shadows, transition-colors duration-500). Visual <use> set pointer-events-none; transform origins set per-cell.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • Zahnentferner

Poem

🐰✨ I hop among shapes, a gentle spin,
Each cell a twirl that starts within.
Shadows bloom and colors glide,
Alternating turns on every side.
A tiny dance — a patterned grin.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(ui): Pattern hover animation drift and flicker' directly addresses the main changes in the pull request: fixing SVG hover animation drift and flickering issues in the Pattern component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/shared/Pattern.jsx (1)

56-56: Drop cursor-pointer unless these cells become clickable.

The new hit area makes every tile hoverable, but nothing here is actionable. Keeping the pointer cursor suggests a click target that does not exist.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/shared/Pattern.jsx` at line 56, In the Pattern component
remove the misleading 'cursor-pointer' utility from the group element so
non-actionable tiles don't show a pointer; locate the <g> element rendered with
key using rowIndex and columnIndex (the JSX building the tile groups) and drop
'cursor-pointer' from its className (or conditionally include it only when the
tile is actually clickable).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/shared/Pattern.jsx`:
- Line 20: In Pattern.jsx the root <svg> sets className="overflow-visible" but
then spreads {...props} last which lets callers overwrite it; change the <svg>
to compose className instead (e.g., merge "overflow-visible" with any incoming
props.className) and spread the remaining props without className so callers'
classes are appended rather than replacing the root class; locate the SVG in the
Pattern component and implement the merge (using your project's class-merge
helper or simple string concat/clsx) and ensure you remove className from the
spreaded props.

---

Nitpick comments:
In `@src/components/shared/Pattern.jsx`:
- Line 56: In the Pattern component remove the misleading 'cursor-pointer'
utility from the group element so non-actionable tiles don't show a pointer;
locate the <g> element rendered with key using rowIndex and columnIndex (the JSX
building the tile groups) and drop 'cursor-pointer' from its className (or
conditionally include it only when the tile is actually clickable).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 840605f6-b567-46db-8b9b-7a030194e037

📥 Commits

Reviewing files that changed from the base of the PR and between 6b95f35 and 631442a.

📒 Files selected for processing (1)
  • src/components/shared/Pattern.jsx

Fix it :
Potential issue | 🟠 Major

Compose className instead of letting props overwrite overflow-visible.
Copy link
Contributor Author

@ankitkr104 ankitkr104 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix it:
Potential issue | 🟠 Major

Compose className instead of letting props overwrite overflow-visible.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/shared/Pattern.jsx (1)

3-20: ⚠️ Potential issue | 🔴 Critical

className is referenced but never destructured — this causes a ReferenceError.

Line 20 uses className in the template literal, but the variable is never destructured from props. It remains inside ...props, so className is undefined in scope.

🐛 Proposed fix: destructure className from props
 export function Pattern({
   size = 40,
   gapX = 16,
   gapY = 8,
   pattern = [
     [0, 1, 0, 1, 1, 0, 1, 0],
     [1, 0, 1, 1, 0, 0, 0, 1],
     [0, 1, 0, 1, 1, 0, 1, 0],
     [1, 0, 1, 1, 0, 0, 0, 1],
   ],
+  className,
   ...props
 }) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/shared/Pattern.jsx` around lines 3 - 20, The Pattern component
references className but never destructures it from props, causing a
ReferenceError; update the Pattern function signature to destructure className
(e.g., export function Pattern({ size = 40, gapX = 16, gapY = 8, pattern =
[...], className, ...props }) ) so className is available for the className
template literal, leaving other props spread as before; ensure the rest of the
code (useId, width, height, and the svg return) remains unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/shared/Pattern.jsx`:
- Around line 24-29: The SVG circle (and other SVG primitives in Pattern.jsx at
the same block around lines 38–44) use the Tailwind class "shadow-xl" which has
no effect on SVG elements; either remove the ineffective "shadow-xl" class from
the <circle>/<rect> elements or implement an SVG shadow filter and apply it via
the element's filter attribute (e.g., add a <defs> with an <filter
id="svg-drop-shadow"> containing <feDropShadow> and set
filter={`url(`#svg-drop-shadow`)`}) so the shadow renders correctly;
alternatively, wrap the SVG in a parent element and use Tailwind's drop-shadow
utilities on that container if you prefer CSS-based shadows.

---

Outside diff comments:
In `@src/components/shared/Pattern.jsx`:
- Around line 3-20: The Pattern component references className but never
destructures it from props, causing a ReferenceError; update the Pattern
function signature to destructure className (e.g., export function Pattern({
size = 40, gapX = 16, gapY = 8, pattern = [...], className, ...props }) ) so
className is available for the className template literal, leaving other props
spread as before; ensure the rest of the code (useId, width, height, and the svg
return) remains unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 440e2f0e-02d4-4180-9d2a-45cb6b484eb2

📥 Commits

Reviewing files that changed from the base of the PR and between 631442a and 6402202.

📒 Files selected for processing (1)
  • src/components/shared/Pattern.jsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant